/*
 * @Author: Crism
 * @Date: 2018-11-01 10:27:49
 * @LastEditors: Crism
 * @LastEditTime: 2018-11-13 16:00:28
 * @Email: crism@qq.com
 * @Description: 
 */

const pkg = require('./package.json');
/** ServerConfig */
const config = {
    debug: false,
    host: '127.0.0.1',
    port: 8088,
    name: 'MUSIC_CMS',
    version: pkg.version,
}
/** Filelog */
const fs = require('fs');
const errorLogfile = fs.createWriteStream(__dirname + '/logs/error.log', { flags: 'a', encoding: null, mode: 0777 });
/** MysqlClient */
const db_config = require('./config/db_config');
const DB = require('./libs/DB');
const db_cms = new DB(db_config.db_cms_config);
const db_files = new DB(db_config.db_files_config);
const db_user = new DB(db_config.db_user_config);
/** RedisClient */
const redis_config = require('./config/redis_config');
const RedisClient = require('./libs/RedisClient');
const redis_user = new RedisClient(redis_config.redis_user_config);
const redis_session = new RedisClient(redis_config.redis_session_config);
/** Exports */
module.exports.redis_user = redis_user;
module.exports.redis_session = redis_session;
module.exports.config = config;
module.exports.db_cms = db_cms;
module.exports.db_files = db_files;
module.exports.db_user = db_user;
module.exports.errorLogfile = errorLogfile;

